#include <fstream>
#include <iostream>

using namespace std;

void read(ifstream &T) //pass the file stream to the function
{	
//the method to read a file, that I showed you before
	char ch;

	while(!T.eof())
	{
		T.get(ch);
        int  newkey   = ch;
        char ASCII    = newkey & 0xff;
		if(ASCII >= 32 && ASCII <= 126){
			cout << ch << "\n";
		}
		else{
			cout  << "\n";
		}
	}
	
	cout << endl << "--------" << endl;
}

int main()
{
	ifstream T("RWInbox.sms");
	read(T);
	T.close();

	T.open("file2.txt");
	read(T);
	T.close();
	return 0;
}
